<?php

function irc_connect($config)
{
	$socket = fsockopen($config['server'], $config['port']);
	fputs($socket, "USER ".$config['nick']." ".$config['nick']." ".$config['nick']." ".$config['nick']." :".$config['real_name']."\n");
	fputs($socket, "NICK ".$config['nick']."\n");
	fputs($socket, "JOIN ".$config['channel']."\n");
	
	return $socket;
}